package drds.data_propagate.binlog.event;

import drds.data_propagate.binlog.BinLogEvent;
import drds.data_propagate.binlog.Buffer;

/**
 * Execute_load_log_event.
 *
 * @author <a href="mailto:changyuan.lh@taobao.com">Changyuan.lh</a>
 * @version 1.0
 */
public final class ExecuteLoadEvent extends BinLogEvent {

    /* EL = "Execute Load" */
    public static final int EL_FILE_ID_OFFSET = 0;
    private final long fileId;

    public ExecuteLoadEvent(Header header, Buffer buffer, FormatDescriptionEvent formatDescriptionEvent) {
        super(header);

        final int commonHeaderLength = formatDescriptionEvent.commonHeaderLength;
        buffer.position(commonHeaderLength + EL_FILE_ID_OFFSET);
        fileId = buffer.getUint32(); // EL_FILE_ID_OFFSET
    }

    public final long getFileId() {
        return fileId;
    }
}
